package com.ranjiaqi.compatator;

import java.util.Set;
import java.util.TreeSet;

/**
 * @ClassName TestTreeSet
 * @Description TODO
 * @Author hp
 * @Date 2021/6/25 8:52
 * @Version 1.0
 **/
public class TestTreeSet {
    public static void main(String[] args) {
        Set<Person> peopleSet = new TreeSet<Person>(new PersonComparator());
        peopleSet.add(new Person("冉佳奇",23));
        peopleSet.add(new Person("崔奥杰",23));
        peopleSet.add(new Person("马计费",20));
        System.out.println(peopleSet);
    }
}
